package com.party.mobile.web.controller.photo;

import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import com.party.common.utils.wechat.WechatUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @Description:
 * @Author: yangshoukun
 * @Date: 2018/6/22 13:53
 */
@Controller
@RequestMapping("/test")
public class TestTestTestController {

    @ResponseBody
    @RequestMapping("/test")
    public String test() {
        String url = "https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend?access_token=";
        String access_token = "10_bykO5oOdECw1FZbG2WMJPwdLA8YbAB3YUYbFiNaf04OA6KrNuDgKoTBWn1L1mYACnU4eh6XFd-R8y51gTOCRcDNsyQ7A1Hhlhs767L_knEFnsYcj_GXIVUpUGVEGJUiAFAWZK";
        Map<String, String> param = Maps.newHashMap();
        param.put("begin_date", "20180515");
        param.put("end_date", "20180515");
        JSONObject jsonObject = WechatUtils.httpRequest(url.concat(access_token), WechatUtils.POST, JSONObject.toJSONString(param));

        return jsonObject.toJSONString();
    }
}
